package java6681.sort.list;

/**
 * @author Junichiro
 * @description 表示某课程的成绩
 * @date 2021-04-06 0:40
 **/

public class Course6681 implements Comparable<Course6681> {
    /*课程名称*/
    private String name;
    /*学分*/
    private int credit;
    /*成绩*/
    private int score;
    /*开课学期*/
    private String term;
    /*课程编号*/
    private String no;

    public Course6681(String name, int credit, int score, String term, String no) {
        this.name = name;
        this.credit = credit;
        this.score = score;
        this.term = term;
        this.no = no;
    }

    public Course6681() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getCredit() {
        return credit;
    }

    public void setCredit(int credit) {
        this.credit = credit;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public String getTerm() {
        return term;
    }

    public void setTerm(String term) {
        this.term = term;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    @Override
    public String toString() {
        return "成绩：" + score + ", " + term + ", " + credit + "学分" + "【" + no + " " + name + "】";
    }

    @Override
    public int compareTo(Course6681 c) {
        int num = c.score - this.score;
        return num;
    }
}
